#ifndef IMAGELOADTHREAD_H
#define IMAGELOADTHREAD_H

#include <QObject>
#include <QTimer>
#include <QImage>

/******************************************************************************
 *
 * @file       imageloadthread.h
 * @brief      图片定时加载线程
 *
 * @author     helx
 * @date       2025/11/02
 * @history
 *****************************************************************************/

class ImageLoadThread : public QObject
{
    Q_OBJECT
public:
    explicit ImageLoadThread(QObject *parent = nullptr);
    ~ImageLoadThread();



public slots:
    void startWork(float interval,const QString& folderPath);
    void stopWork();
    void initTimer();

    // 单位s
    void setTimerInterval(float interVal);

signals:
    void sig_loadImage(const QImage& image);

private slots:
    void slot_timeOutLoadImage();

private:
    void scanImageFromFolderPath(const QString& folderPath);


private:
    QTimer* _loadTimer; // 加载的时间间隔
    QImage _image;
    QVector<QString> _Image_Path_Vec;

    int _current_index; // 当前显示索引

    QString _last_path;

};

#endif // IMAGELOADTHREAD_H
